<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGiftBagEditScoreIntmacyLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gift_bag_edit_score_intimacy_log', function (Blueprint $table) {
            $table->increments('id');//自增id
            $table->integer('user_id')->comment('送用户id');
            $table->integer('to_user_id')->comment('收用户id');
            $table->tinyInteger('type')->default(1)->comment('1送礼榜 2 收礼 3 积分 4亲密值');
            $table->integer('old_num')->comment('原始值');
            $table->integer('new_num')->comment('新补发值');
            $table->tinyInteger('status')->default(0)->comment('0未领取 1已领取');
            $table->timestamps();
            $table->index(['user_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('gift_bag_edit_score_intimacy_log');
    }
}
